﻿
using System;
using System.Net;
namespace Inovout.Net
{
    public class HttpResponse
    {
        public HttpRequest Request { get;private set; }
        public IHttpResponseParser HttpResponseParser { get; private set; }
        public HttpResponse(HttpRequest request,IHttpResponseParser httpresponseParser)
        {
            Request = request;
            HttpResponseParser = httpresponseParser;
        }
        public HttpWebResponse HttpWebResponse { get; private set; }
        public void ResponseCallback(IAsyncResult asyncResult)
        {
            HttpWebResponse = (HttpWebResponse)Request.HttpWebRequest.EndGetResponse(asyncResult);
            HttpResponseParser.Parse(HttpWebResponse.GetResponseStream());
        }
    }
}
